template(name="listBody")
  .list-body.js-perfect-scrollbar
    .minicards.clearfix.js-minicards
      if cards.count
        +inlinedForm(autoclose=false position="top")
          +addCardForm(listId=_id position="top")
      each cards
        a.minicard-wrapper.js-minicard(href=absoluteUrl
          class="{{#if cardIsSelected}}is-selected{{/if}}"
          class="{{#if MultiSelection.isSelected _id}}is-checked{{/if}}")
          if MultiSelection.isActive
            .materialCheckBox.multi-selection-checkbox.js-toggle-multi-selection(
              class="{{#if MultiSelection.isSelected _id}}is-checked{{/if}}")
          +minicard(this)
      if currentUser.isBoardMember
        +inlinedForm(autoclose=false position="bottom")
          +addCardForm(listId=_id position="bottom")
        else
          a.open-minicard-composer.js-card-composer.js-open-inlined-form
            i.fa.fa-plus
            | {{_ 'add-card'}}

template(name="addCardForm")
  .minicard.minicard-composer.js-composer
    .minicard-detailss.clearfix
      textarea.minicard-composer-textarea.js-card-title(autofocus)
      .minicard-members.js-minicard-composer-members
  .add-controls.clearfix
    button.primary.confirm(type="submit") {{_ 'add'}}
    a.fa.fa-times-thin.js-close-inlined-form
